package com.echat.companydata.exception;

import com.echat.commonlib.bean.HttpResult;
import org.springframework.http.MediaType;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;

import javax.servlet.http.HttpServletRequest;

/**
 * Created by chenmohan on 2018/09/03
 *
 * @description 直接使用的SpringMvc
 */
@RestController
public class JsonErrorController {

    @RequestMapping(value = "/errorWithJson", produces = MediaType.APPLICATION_JSON_UTF8_VALUE)
    public HttpResult errorWithJson(HttpServletRequest request, Integer code, String msg) {
        String s = request.getRequestURI();
        return HttpResult.error(code, msg);
    }

}
